### -*- coding: utf-8 -*- #############################################
# Разработано Паэглит Арвидом (http://arvid.dp.ua/)
# Все права защищены, 2007
#
# Developed by Paeglit Arvid (http://arvid.dp.ua/)
# All right reserved, 2007
#######################################################################
"""User Add mail installation methods

$Id: install.py 35 2007-12-11 12:38:03Z Arvi3D $

"""
__author__  = "Arvid"
__license__ = "GPL"
__version__ = "$Revision: 35 $"
__date__ = "$Date: 2007-12-11 12:38:03 +0000 (Tue, 11 Dec 2007) $"

from zope.app import zapi
from zope.interface import alsoProvides, noLongerProvides

from arvidcontent.useraddmail.interfaces import IUserAddMailable, IUserAddMail

def installUserAddMail(context, name = u'mount_user', **kw):
    sm = context.getSiteManager()

    alsoProvides(sm[name], IUserAddMailable)
    ma = IUserAddMail(sm[name])
    ma.channel = "AddPrincipalSMTPChannel"
    ma.ismailable = True

    return "OK"

def deleteUserAddMail(context, name = u'mount_user', **kw):
    sm = getSiteManager(context)
    noLongerProvides(sm[name], IUserAddMailable)

    return 'OK'
